﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net.Sockets;

namespace ggprot
{
    public class GGNewStatus : GGHeader
    {
        private int status;
        private int flags;
        private int descriptionSize;
        private string description;

        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        public int Status
        {
            get { return status; }
            set { status = value; }
        }

        public int Flags
        {
            get { return flags; }
            set { flags = value; }
        }

        public int DescriptionSize
        {
            get { return descriptionSize; }
            set { descriptionSize = value; }
        }

        public override void Write(NetworkStream stream)
        {
            base.Write(stream);

            BinaryWriter writer = new BinaryWriter(stream);

            writer.Write(status);
            writer.Write(flags);
            writer.Write(descriptionSize);
            if (descriptionSize > 0)
                writer.Write(description.ToCharArray());
        }
    }
}
